


#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"

#include "tolua++.h"

#include "../luaComplex.h"
#include "../luaComplexEx.h"
#include <complex>

#include <fstream>


/* method: add of class  std::complex<double> */
int tolua_luaComplex_std_complex__add00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"std::complex<double>",0,&tolua_err) ||
     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const std::complex<double>",0,&tolua_err)) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,1,0);
  const std::complex<double>* tolua_var_2 = ((const std::complex<double>*)  tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'add'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  add(self,*tolua_var_2);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function '.add'.",&tolua_err);
 return 0;
#endif
}

/* method: sub of class  std::complex<double> */
int tolua_luaComplex_std_complex__sub00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"std::complex<double>",0,&tolua_err) ||
     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const std::complex<double>",0,&tolua_err)) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,1,0);
  const std::complex<double>* tolua_var_3 = ((const std::complex<double>*)  tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'sub'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  sub(self,*tolua_var_3);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function '.sub'.",&tolua_err);
 return 0;
#endif
}

/* method: mul of class  std::complex<double> */
int tolua_luaComplex_std_complex__mul00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"std::complex<double>",0,&tolua_err) ||
     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const std::complex<double>",0,&tolua_err)) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,1,0);
  const std::complex<double>* tolua_var_4 = ((const std::complex<double>*)  tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'mul'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  mul(self,*tolua_var_4);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function '.mul'.",&tolua_err);
 return 0;
#endif
}

/* method: div of class  std::complex<double> */
int tolua_luaComplex_std_complex__div00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"std::complex<double>",0,&tolua_err) ||
     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const std::complex<double>",0,&tolua_err)) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,1,0);
  const std::complex<double>* tolua_var_5 = ((const std::complex<double>*)  tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'div'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  div(self,*tolua_var_5);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function '.div'.",&tolua_err);
 return 0;
#endif
}

/* method: add of class  std::complex<double> */
int tolua_luaComplex_std_complex__add01(lua_State* tolua_S)
{
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"std::complex<double>",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,1,0);
  const double tolua_var_6 = ((const double)  tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'add'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  add(self,tolua_var_6);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
   tolua_pushnumber(tolua_S,(lua_Number)tolua_var_6);
  }
 }
 return 2;
tolua_lerror:
 return tolua_luaComplex_std_complex__add00(tolua_S);
}

/* method: sub of class  std::complex<double> */
int tolua_luaComplex_std_complex__sub01(lua_State* tolua_S)
{
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"std::complex<double>",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,1,0);
  const double tolua_var_7 = ((const double)  tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'sub'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  sub(self,tolua_var_7);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
   tolua_pushnumber(tolua_S,(lua_Number)tolua_var_7);
  }
 }
 return 2;
tolua_lerror:
 return tolua_luaComplex_std_complex__sub00(tolua_S);
}

/* method: mul of class  std::complex<double> */
int tolua_luaComplex_std_complex__mul01(lua_State* tolua_S)
{
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"std::complex<double>",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,1,0);
  const double tolua_var_8 = ((const double)  tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'mul'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  mul(self,tolua_var_8);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
   tolua_pushnumber(tolua_S,(lua_Number)tolua_var_8);
  }
 }
 return 2;
tolua_lerror:
 return tolua_luaComplex_std_complex__mul00(tolua_S);
}

/* method: div of class  std::complex<double> */
int tolua_luaComplex_std_complex__div01(lua_State* tolua_S)
{
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"std::complex<double>",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,1,0);
  const double tolua_var_9 = ((const double)  tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'div'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  div(self,tolua_var_9);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
   tolua_pushnumber(tolua_S,(lua_Number)tolua_var_9);
  }
 }
 return 2;
tolua_lerror:
 return tolua_luaComplex_std_complex__div00(tolua_S);
}


/* method: add of class  std::complex<double> */
int tolua_luaComplex_std_complex__add02(lua_State* tolua_S)
{

 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,2,"std::complex<double>",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
 {
	 std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,2,0);
  const double tolua_var_10 = ((const double)  tolua_tonumber(tolua_S,1,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'add'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  add(tolua_var_10,*self);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
   tolua_pushnumber(tolua_S,(lua_Number)tolua_var_10);
  }
 }
 return 2;
tolua_lerror:
 return tolua_luaComplex_std_complex__add01(tolua_S);
}

/* method: sub of class  std::complex<double> */
int tolua_luaComplex_std_complex__sub02(lua_State* tolua_S)
{
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,2,"std::complex<double>",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,2,0);
  const double tolua_var_11 = ((const double)  tolua_tonumber(tolua_S,1,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'sub'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  sub(tolua_var_11,*self);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
   tolua_pushnumber(tolua_S,(lua_Number)tolua_var_11);
  }
 }
 return 2;
tolua_lerror:
 return tolua_luaComplex_std_complex__sub01(tolua_S);
}

/* method: mul of class  std::complex<double> */
int tolua_luaComplex_std_complex__mul02(lua_State* tolua_S)
{
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,2,"std::complex<double>",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,2,0);
  const double tolua_var_12 = ((const double)  tolua_tonumber(tolua_S,1,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'mul'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  mul(tolua_var_12,*self);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
   tolua_pushnumber(tolua_S,(lua_Number)tolua_var_12);
  }
 }
 return 2;
tolua_lerror:
 return tolua_luaComplex_std_complex__mul01(tolua_S);
}

/* method: div of class  std::complex<double> */
int tolua_luaComplex_std_complex__div02(lua_State* tolua_S)
{
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,2,"std::complex<double>",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
 {
  std::complex<double>* self = (std::complex<double>*)  tolua_tousertype(tolua_S,2,0);
  const double tolua_var_13 = ((const double)  tolua_tonumber(tolua_S,1,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'div'", NULL);
#endif
  {
   tolua_outside std::complex<double> tolua_ret = (tolua_outside std::complex<double>)  div(tolua_var_13,*self);
   {
#ifdef __cplusplus
    void* tolua_obj = Mtolua_new((std::complex<double>)(tolua_ret));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#else
    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(std::complex<double>));
     tolua_pushusertype(tolua_S,tolua_obj,"std::complex<double>");
    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
#endif
   }
   tolua_pushnumber(tolua_S,(lua_Number)tolua_var_13);
  }
 }
 return 2;
tolua_lerror:
 return tolua_luaComplex_std_complex__div01(tolua_S);
}

